itertoolsproduct hackerrank solution in python